package com.kwin;

import redis.clients.jedis.Jedis;
import redis.clients.jedis.Tuple;

import java.util.Set;

public class TestZSet {
    public static void main(String[] args) {
        Jedis jedis = new Jedis("127.0.0.1", 6379);
        jedis.zadd("zset", 100d, "zhangsan");
        jedis.zadd("zset", 50d, "lisi");
        jedis.zadd("zset", 1000d, "xiaohong");

        Set<String> zset = jedis.zrange("zset", 0, -1);
        Set<Tuple> zset1 = jedis.zrangeWithScores("zset", 0, -1);
        System.out.println(zset);
        System.out.println(zset1);
    }
}
